﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EZCRS.HCMS.SqlClient;
using System.Data;

namespace EZCRS.HCMS.Bll.userinfo
{
    public class Bllscore
    {
        #region 常客消费记录列表
        public DataTable Score_List(string Uid)
        {
            Uid = CFun.VerifySQL(Uid);
            return new sql_AdmScore().Score_List(Uid);
        }
        #endregion
        #region 常客消费记录信息添加、修改
        /// <summary>
        /// 修改或添加常客消费记录信息
        /// </summary>
        /// <returns></returns>
        public bool Score_Add(string Uid, string Talyear, string Talbooktimes, string Talroomnights, string Talconsumenights, string Talhotelcount, decimal Talmount, string Talscore, string Talid)
        {
            Talid = CFun.VerifySQL(Talid);

            return new sql_AdmScore().Score_Add(Uid, Talyear, Talbooktimes, Talroomnights, Talconsumenights, Talhotelcount, Talmount, Talscore, Talid);
        }
        #endregion
        #region 常客消费记录Info数据的显示,显示一条数据
        public DataRow Score_Item(string Talid)
        {
            Talid = CFun.VerifySQL(Talid);

            return new sql_AdmScore().Score_Item(Talid);
        }
        #endregion
        #region 常客消费记录的删除
        public bool Score_Del(string Talid)
        {
            Talid = CFun.VerifySQL(Talid);
            return new sql_AdmScore().Score_Del(Talid);
        }
        #endregion
        #region 消费记录统计
        public void userstat(int uid, int year)
        {
             new sql_AdmScore().userstat(uid, year);
        }
        #endregion

        /////////////////////////////////////////////////////////////////

        /// <summary>
        /// 返回查询的积分日志
        /// </summary>
        /// <param name="cpage">页数</param>
        /// <param name="bstart">开始时间</param>
        /// <param name="bend">结束时间</param>
        /// <param name="logsort">积分类型</param>
        /// <param name="valid">有效否</param>
        /// <returns></returns>
        public DataSet scoreloglist(string gid, string uid, int cpage, string bstart, string bend, string logsort, string valid)
        {
            return new sql_AdmScoreLog().scoreloglist(gid, uid, cpage, bstart, bend, logsort, valid);
        }

        /// <summary>
        /// 修改积分日志状态
        /// </summary>
        /// <param name="logid">要修改的id列</param>
        /// <returns></returns>
        public bool scorelogstatus(string logid)
        {
            return new sql_AdmScoreLog().scorelogstatus(logid);
        }

        /// <summary>
        /// 买积分
        /// </summary>
        /// <param name="gid"></param>
        /// <param name="uid"></param>
        /// <param name="scorerate"></param>
        /// <param name="totalmoney"></param>
        /// <param name="totalscore"></param>
        /// <param name="admin"></param>
        /// <returns></returns>
        public decimal scorebuy(string gid, string uid, string totalmoney, string admin)
        {
            return new sql_AdmScoreLog().scorebuy(gid, uid, totalmoney, admin);
        }


        ////////////////////////////////

        #region 酒店或集团积分设置信息列表
        /// <summary>
        /// 酒店或集团积分设置列表
        /// </summary>
        /// <param name="OrgId">组织编号</param>
        /// <param name="OrgType">组织类型 2=集团  1=酒店 3=hubs1</param>
        /// <returns></returns>
        public DataTable ScoreSetUp_List(string OrgId, string OrgType)
        {
            OrgId = CFun.VerifySQL(OrgId);
            OrgType = CFun.VerifySQL(OrgType);

            return new sql_AdmScoreSetUp().ScoreSetUp_List(OrgId, OrgType);
        }
        #endregion

        #region 酒店或集团积分设置信息添加、修改
        /// <summary>
        /// 修改或添加酒店或集团积分设置信息
        /// </summary>
        /// <returns></returns>
        public bool ScoreSetUp_Add(string Orgid, string Orgtype, string Stpname, string Startdate, string Enddate, string Lvlid, string Hotelstar, string Roomtype, string Unitscore, string Stpcomment, string Indate, string Inuser, string Stpid)
        {
            Stpid = CFun.VerifySQL(Stpid);
            return new sql_AdmScoreSetUp().ScoreSetUp_Add(Orgid, Orgtype, Stpname, Startdate, Enddate, Lvlid, Hotelstar, Roomtype, Unitscore, Stpcomment, Indate, Inuser, Stpid);
        }
        #endregion
        #region 酒店或集团积分设置Info数据的显示,显示一条数据
        public DataRow ScoreSetUp_Item(string Stpid)
        {
            Stpid = CFun.VerifySQL(Stpid);

            return new sql_AdmScoreSetUp().ScoreSetUp_Item(Stpid);
        }
        #endregion
        #region 酒店或集团积分设置的删除
        public bool ScoreSetUp_Del(string Stpid)
        {
            Stpid = CFun.VerifySQL(Stpid);
            return new sql_AdmScoreSetUp().ScoreSetUp_Del(Stpid);
        }
        #endregion
    }
}
